package com.xuanyuan.arouterdemo

import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.launcher.ARouter
import com.xuanyuan.arouterdemo.base.IArouterConstants

class ArouterActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_arouter)
    }


    /**
     * 通过Uri进行跳转
     */
    fun jumpByUri() {
        val uri = Uri.parse("https://m.aliyun.com/")
        val postcard: Postcard = ARouter.getInstance()
            .build(uri)
        postcard.navigation()
    }

    /**
     * 通过路由路径进行跳转
     */
    fun jumpByArouterPath() {
        val postcard: Postcard = ARouter.getInstance()
            .build(IArouterConstants.PATH_AROUTER_ACTIVITY)
        postcard.navigation()

    }


    /**
     * 带参数跳转路由
     */
    fun jumpWithParameters(){


    }


}